/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sms4j.notification;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.smslib.AGateway;
import org.smslib.IInboundMessageNotification;
import org.smslib.InboundMessage;
import org.smslib.Message.MessageTypes;

/**
 *
 * @author Swang
 */
public class InboundNotification implements IInboundMessageNotification {

    private static final Log log = LogFactory.getLog(InboundNotification.class);

    @Override
    public void process(AGateway gateway, MessageTypes msgType, InboundMessage msg) {
        if (msgType == MessageTypes.INBOUND) {
            log.info(">>> New Inbound message detected from Gateway: " + gateway.getGatewayId());
        } else if (msgType == MessageTypes.STATUSREPORT) {
            log.info(">>> New Inbound Status Report message detected from Gateway: " + gateway.getGatewayId());
        }
        log.info(msg);
    }
}
